#ifndef BIG_INTEGER_H
#define BIG_INTEGER_H

#include <fstream>
#include <string>
#include <vector>
#include <ios>
#include <assert.h>

const int EXTERNAL_BASE = 10;
const int BASE = 1000*1000*1000;
const int K = 9;

struct big_integer
{
   std::vector<int> digits;

   big_integer()
   {
   }

   big_integer(const std::string&);

   big_integer(const std::vector<int>& a):
      digits(a)
   {}

};

bool operator<(const big_integer&,const big_integer&);

big_integer operator*(const big_integer&, const int&);

bool operator==(const big_integer&, int);
bool operator==(int, const big_integer&);

bool operator!=(int, const big_integer&);
bool operator!=(const big_integer&, int);

int compare(const big_integer&, const big_integer&, int);

void subtruct(big_integer&, const big_integer&, int);

struct quotient_and_remainder
{
   big_integer quotient;
   big_integer remainder;

   quotient_and_remainder(const big_integer& a, const big_integer& b): 
      quotient(a),
      remainder(b)
   {}
};

quotient_and_remainder operator/(const big_integer&, const big_integer&);

std::ofstream& operator<<(std::ofstream&, const big_integer&);
std::ofstream& operator<<(std::ofstream&, const quotient_and_remainder&);

#endif